#ifndef __VOLTAGETRACE_H
#define __VOLTAGETRACE_H
#include <cstdio>
#include <iostream>
#include "../HSGlobal.h"

typedef struct {
    double time;
    double value;
} trace_elt;

class VoltageTrace {
    trace_elt *trace;
    unsigned long numSamples;
    unsigned long sampleRate; // in Hz
    double traceDuration;     // in s

public:
    double lastVoltageReturned; // in V

    VoltageTrace ();

    int loadFromFile (const char* const filename);

    double getVoltage (double time);

    ~VoltageTrace ();
};

#endif // __VOLTAGETRACE_H
